package lumis.service.wsrp.producer;

import lumis.portal.PortalException;
import lumis.portal.authentication.SessionConfig;
import lumis.portal.serviceinterfaceinstance.IServiceInterfaceInstanceOwner;
import lumis.portal.serviceinterfaceinstance.ServiceInterfaceInstanceConfig;
import lumis.portal.serviceinterfaceinstance.ServiceInterfaceInstancePermission;

/**
 * Service interface instance owner.
 *
 * @version $Revision: 13092 $ $Date: 2011-05-28 18:19:06 -0300 (Sat, 28 May 2011) $
 * @since 6.0.0
 */
public final class ServiceInterfaceInstanceOwner implements IServiceInterfaceInstanceOwner
{
	private static final IServiceInterfaceInstanceOwner INSTANCE = new ServiceInterfaceInstanceOwner();
	
	public boolean checkPermission(SessionConfig sessionConfig,
			ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig, ServiceInterfaceInstancePermission permission)
			throws PortalException
	{
		// TODO SAML
		/*
		ITransaction transaction = PortalTransactionFactory.getCurrentTransaction();
		return ManagerFactory.getServiceInstanceAclManager().checkPermission(sessionConfig, 
																		serviceInterfaceInstanceConfig.getServiceInstanceId(), 
																		ServicePermissions.MANAGE_SERVICE, 
																		transaction);
		*/
		return true;
	}

	public static IServiceInterfaceInstanceOwner getInstance()
	{
		return INSTANCE;
	}
}
